import { Entity,Column,PrimaryGeneratedColumn,ManyToOne,JoinColumn } from 'typeorm'
import { User } from '../user/user.entity'

@Entity()
export class Message {
    @PrimaryGeneratedColumn()
    id: number;

    @Column()
    content: string;

    @Column({ name: 'send_time'})
    sendTime: string;

    @ManyToOne(type => User,user => user.messages)
    @JoinColumn({ name: 'send_user_id' })
    sendUser: User
}